package grpc

import (
	"time"

	"google.golang.org/grpc/grpclog"
)

// ServerOption is gRPC server option.
type ServerOption func(o *Server)

// WithNetwork with server network.
func WithNetwork(network string) ServerOption {
	return func(s *Server) {
		s.network = network
	}
}

// WithAddress with server address.
func WithAddress(addr string) ServerOption {
	return func(s *Server) {
		s.address = addr
	}
}

// WithLog with server log
func WithLog(log grpclog.LoggerV2) ServerOption {
	return func(s *Server) {
		s.log = log
	}
}

// WithTimeout with server timeout
func WithTimeout(t time.Duration) ServerOption {
	return func(o *Server) {
		o.timeout = t
	}
}
